package Capa_Modelo;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Query;

import Capa_Datos.CD_Laboratorio;

public class CM_ImplLaboratorio extends CM_BaseDao implements CM_Laboratorio{
	
	public CM_ImplLaboratorio(){
		super();
	}
	
	
	@SuppressWarnings("unchecked")
	@Override
	public List<CD_Laboratorio> obtenerLaboratorio() {
		List<CD_Laboratorio> lista_laboratorios;
		try{
			lista_laboratorios= new ArrayList<CD_Laboratorio>();
			em.getTransaction().begin();
			Query q=  em.createQuery("SELECT a FROM CD_Laboratorio a WHERE a.unidad =: codigo");
			q.setParameter("codigo",null);
		    lista_laboratorios=q.getResultList();		    
		    em.getTransaction().commit();
		    
		}catch(Exception e){
			System.out.print("EEEEEEEEEERROR 4x4--->"+e);
			return null;
			
		}
		return lista_laboratorios;
		
		
	}

}
